package com.ipmirror.navigation;

/**
 * Created by denny
 * User: denny
 * Date: Oct 11, 2010
 * Time: 2:20:40 PM
 */
public enum NavigationEnum {
    REGISTRY_CONSOLE_HOME("home_id","/pages/home.xhtml","common.default.title"),
    DEFAULT_EXCEPTION("exception_menu_id","/pages/error.xhtml","common.exception.pagetitle"),
    DOMAIN_SEARCH("domains_search","/pages/domains_search.xhtml","domains.search.title"),
    MOBILE_ITEM_NEW("newmobileitem","/pages/mobile_item_new.xhtml","mobile.item.new.tilte"),
    MOBILE_ITEM("searchmobileitem","/pages/mobile_item.xhtml","mobile.item.tilte"),
    MOBILE_PRODUCT_NEW("new_mobile_product","/pages/mobile_product_new.xhtml","mobile.product.title"),
    MOBILE_PRODUCT("search_mobile_procuct","/pages/mobile_product.xhtml","mobile.product.new.title");

    private final String menuLink;
    private final String menuId;
    private final String pageTitle;

    NavigationEnum(String menuId, String menuLink, String pageTitle) {
        this.menuLink = menuLink;
        this.menuId = menuId;
        this.pageTitle = pageTitle;
    }

    public static NavigationEnum fromString(final String menuId) {
        NavigationEnum result = null;
        if (menuId != null) {
            for (final NavigationEnum nav : NavigationEnum.values()) {
                if (nav.menuId.equals(menuId)) {
                    result = nav;
                    break;
                }
            }
        }
        return result;
    }


    public String getMenuLink() {
        return menuLink;
    }


    public String getMenuId() {
        return menuId;
    }

    public String getPageTitle() {
        return pageTitle;
    }
}
